﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace MyBlog.WebAPI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : ControllerBase
    {
        [HttpGet("NoAuthorize")]
        public string NoAuthorize()
        {
            return "this is NoAuthorize";
        }
        [Authorize]
        [HttpGet("Authorize")]
        public string Authorize()
        {
            return "this is Authorize";
        }
        [TypeFilter(typeof(CustomResourceFilterAttribute))]
        [HttpGet("GetCache")]
        public IActionResult GetCache(string name)
        {
            return new JsonResult(new
            {
                name,
                age = 18,
                sex = true
            });
        }
    }
}
